function fn_reportetecnico()
{
	vc_pag = 'reportetecnico.jsp'
	window.open(vc_pag,'_blank','width=790,height=535,top=0,left=0,scrollbars=yes,menubar=yes,toolbar=yes')
}

function fn_reporteestado()
{
	vc_pag = 'reporteestado.jsp'
	window.open(vc_pag,'_blank','width=790,height=535,top=0,left=0,scrollbars=yes,menubar=yes,toolbar=yes')
}

function fn_solicitud()
{  window.showModalDialog("solicitud.jsp",0,"center:yes;resizable:no;status:no;help:no;dialogWidth:500px;dialogHeight:400px;");
}

function fn_asignartecnico()
{  window.showModalDialog("asignartecnico.jsp",0,"center:yes;resizable:no;status:no;help:no;dialogWidth:500px;dialogHeight:400px;");
}

function fn_cambiarestado()
{  window.showModalDialog("cambiarestado.jsp",0,"center:yes;resizable:no;status:no;help:no;dialogWidth:500px;dialogHeight:400px;");
}

function fn_Enviar()
{   if (fmForm1.ddlTipoUser.value=="cliente")
    {
        with (fmForm1)
	{	action= "missolicitudes.jsp";
		target = "_self";
		submit();
	}
   }
   else
           { with (fmForm1)
            {	action= "listadodesolicitudes.jsp";
                    target = "_self";
                    submit();
            }

       }
}

function fn_AsignarCosto(form) {
    var selec = form.cbxTipos.options;
    var combo = form.cbxSubTipos.options;
    if(selec[0].selected==true){
        form.txtCosto.value = "0.00"
        form.txtIdServicio.value = ""
    }
    if(selec[1].selected==true){
        if(combo[0].selected==true){
            form.txtCosto.value = "10.00"
            form.txtIdServicio.value = "G1"
        }
        if(combo[1].selected==true){
            form.txtCosto.value = "15.00"
            form.txtIdServicio.value = "G2"
        }
    }
    if(selec[2].selected==true){
        if(combo[0].selected==true){
            form.txtCosto.value = "12.00"
            form.txtIdServicio.value = "E1"
        }
        if(combo[1].selected==true){
            form.txtCosto.value = "16.00"
            form.txtIdServicio.value = "E2"
        }
        if(combo[2].selected==true){
            form.txtCosto.value = "20.00"
            form.txtIdServicio.value = "E3"
        }
    }

}

function fn_AsignarCosto(form) {
    var selec = form.cbxTipos.options;
    var combo = form.cbxSubTipos.options;
    if(selec[0].selected==true){
        form.txtCosto.value = "0.00"
        form.txtIdServicio.value = ""
    }
    if(selec[1].selected==true){
        if(combo[0].selected==true){
            form.txtCosto.value = "10.00"
            form.txtIdServicio.value = "G1"
        }
        if(combo[1].selected==true){
            form.txtCosto.value = "15.00"
            form.txtIdServicio.value = "G2"
        }
    }
    if(selec[2].selected==true){
        if(combo[0].selected==true){
            form.txtCosto.value = "12.00"
            form.txtIdServicio.value = "E1"
        }
        if(combo[1].selected==true){
            form.txtCosto.value = "16.00"
            form.txtIdServicio.value = "E2"
        }
        if(combo[2].selected==true){
            form.txtCosto.value = "20.00"
            form.txtIdServicio.value = "E3"
        }
    }

}

function fn_AsignarCosto2(form) {
    var selec = form.cbxTipos.options;

    if (selec[0].selected == true) {
         form.txtCosto.value = "0.00"
    }

    if (selec[1].selected == true) {
         form.txtCosto.value = "150.00"
    }

    if (selec[2].selected == true) {
         form.txtCosto.value = "100.00"
    }

    if (selec[3].selected == true) {
         form.txtCosto.value = "90.00"
    }

    if (selec[4].selected == true) {
         form.txtCosto.value = "50.00"
    }

    if (selec[5].selected == true) {
         form.txtCosto.value = "95.00"
    }

    if (selec[6].selected == true) {
         form.txtCosto.value = "85.00"
    }

}

function myFocus(element) {
    if (element.value != '') {
        var error = element.name + ".errors";
        var errorValidator = document.getElementById(error);
        errorValidator.innerHTML = '';
    }
}

function myAction() {
    var enviar = document.getElementById("enviar");
    enviar.click();
}

function myActionEnvio() {
    var enviar = document.getElementById("proximo");
    enviar.click();
}

function insertHoras(obj) {
    var value = obj.value;
    var horas = document.getElementById("horas");
    horas.value = value + ":00";
}

function insertMinutos(obj) {
    var value = obj.value;
    var horas = document.getElementById("horas");
    var horasStr = horas.subString(0,2);
    horas.value = horasStr + ":" + value;
}